package myWebApp;

/*第三章 垃圾收集器
 *测试需要知识点:通过设置-XX:MAXTenuringThreshold=1参数
 *年龄大于这个值的被分配到老年代
 *jvm 参数:-verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+UseSerialGC -XX:MaxTenuringThreshold=1
 *2017年8月7日15:05:27
 */
public class GC5 {

	public static void main(String[] args) {
		byte[] allocation1,allocation2,allocation3,allocation4;
		allocation1 = new byte[1024*1024/4];
		allocation2 = new byte[1024*1024*4];
		allocation3 = new byte[1024*1024*4];
//		allocation4 = new byte[1024*1024*4];
	}
}

/*注意信息:
 * [GC (Allocation Failure) [DefNew: 5499K->851K(9216K), 0.0025874 secs] 5499K->4947K(19456K), 0.0026312 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
	[GC (Allocation Failure) [DefNew: 4947K->0K(9216K), 0.0021252 secs] 9043K->9043K(19456K), 0.0021420 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
	Heap
	 def new generation   total 9216K, used 4178K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
	  eden space 8192K,  51% used [0x00000000fec00000, 0x00000000ff014930, 0x00000000ff400000)
	  from space 1024K,   0% used [0x00000000ff400000, 0x00000000ff400000, 0x00000000ff500000)
	  to   space 1024K,   0% used [0x00000000ff500000, 0x00000000ff500000, 0x00000000ff600000)
	 tenured generation   total 10240K, used 9043K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
	   the space 10240K,  88% used [0x00000000ff600000, 0x00000000ffed4c40, 0x00000000ffed4e00, 0x0000000100000000)
	 Metaspace       used 2544K, capacity 4486K, committed 4864K, reserved 1056768K
	  class space    used 271K, capacity 386K, committed 512K, reserved 1048576K
 */